The present invention relates to methods and devices for performing block conversion of image data based on image signals that are input in a raster scan order in image input devices such as camera-equipped cellular phones and digital still cameras and obtaining image data in a rectangular area of, for example, 8 pixels×8 pixels.
In general, image data are output from imaging devices, such as CCD sensors and CMOS sensors, in the order in accordance with the scan of raster images. On the other hand, processing of digital images is in many cases performed for each pixel block in a rectangular area. More specifically, in the image data compression according to JPEG (Joint Photographic Coding Experts Group), for example, the processing is performed for each 8 horizontal pixels×8 vertical pixels of pixel block data. For this reason, after temporarily storing the image data output from an imaging device or the like in a memory, it is necessary to perform block conversion for reading each pixel block.
Conventionally, the above-described block conversion has been performed with, for example, a device as shown in FIG. 8. This device is provided with two 8H line memories 502 and 503 (each holding 8 scanning lines of image data) to which image data input in a raster scan order are input in an alternative manner via a selector 501. The writing area and the reading area for image data of each of these 8H line memories 502 and 503 are controlled by a write address control portion 504 and a read address control portion 505, respectively. The read image data are output via a selector 506.
The reason why the two 8H line memories 502 and 503 are provided as described above is to allow, while image data held in one of them is being read, subsequently input image data to be held in the other. That is, it is necessary to perform the reading of pixel block data after the image data up to the 8th line have been written. Therefore, if the image data on the 9th line that are subsequently input are written in the same 8H line memory, then the next image data are written in an area where image data have yet to be read out. For the sake of simple illustration, for example, let us assume that the reading of pixel block data is started from the image data at the left end of the 1st line immediately after completing the writing of all the 8 lines of image data. In this case, first, the image data at the left end of each of the 1 st to 8th lines are read out, and then the image data at the second pixel from the left end of the 1st line are read out in the ninth timing. However, since the writing of image data to be input is performed according to the scan order, in the area where the above-described image data at the second pixel from the left end of the 1 st line are held, new image data are written in the second timing after the start of the writing of the 9th line. Accordingly, the original image data are overwritten and can no longer be read in the above-described 9th timing. It should be noted that in the strict sense, it is also possible to start the reading of pixel block data a little before the completion of the writing of all the 8 lines of image data. In this case also, the above-described problem inevitably occurs, although in a slightly different timing.
For this reason, the two 8H line memories 502 and 503 have conventionally been provided as described above such that the image data that are input while reading is performed in one of the 8H line memories can be written in the other of the 8H line memories.
However, memories for holding image data, especially those having a large number of pixels, tend to increase a circuit scale as a whole, so that the conventional devices have the problem of high manufacturing costs due to large chip areas of LSIs.